import request from '@/utils/request'

// 查询合同登记列表
export function listContract(query) {
  return request({
    url: '/lims/contract/list',
    method: 'get',
    params: query
  })
}

// 查询合同排程列表
export function listSchedu(query) {
  return request({
    url: '/lims/contract/scheduList',
    method: 'get',
    params: query
  })
}

// 查询合同登记详细
export function getContract(contractId) {
  return request({
    url: '/lims/contract/' + contractId,
    method: 'get'
  })
}

// 打开pageOffice
export function viewFormByTemplateId(query) {
  return request({
    url: '/report/template/generateContract',
    method: 'get',
    params: query
  })
}

export function viewFormByFileId(query) {
  return request({
    url: '/report/template/openFileContract',
    method: 'get',
    params: query
  })
}

export function delContractFileId(contractId,wordId) {
  return request({
    url: '/lims/contract/word/' + contractId + "/" + wordId,
    method: 'delete',
  })
}

export function getFile(fileId) {
  return request({
    url: '/system/file/detail/' + fileId,
    method: 'get',
  })
}

export function queryTemplateList() {
  return request({
    url: '/report/template/reportTemplateList?templateType=6',
    method: 'get'
  })
}
// 新增合同登记
export function addContract(data) {
  return request({
    url: '/lims/contract',
    method: 'post',
    data: data
  })
}

// 粘贴客户信息点位
export function pasteCustomPoint(contractId) {
  return request({
    url: '/lims/contract/paste/cumstom/' + contractId,
    method: 'post'
  })
}

// 提交
export function tjContract(contractId) {
  return request({
    url: '/lims/contract/updateContractStatus/' + contractId,
    method: 'post'
  })
}

// 查询合同排程列表
export function getShow() {
  return request({
    url: '/lims/contract/show',
    method: 'get',
  })
}

// 撤回合同
export function revoke(contractId) {
  return request({
    url: '/lims/contract/revoke/' + contractId,
    method: 'post',
  })
}

// 获取报价单列表远程搜索下拉框数据
export function getQuotationList(query) {
  return request({
    url: '/lims/contract/priceList',
    method: 'get',
    params: query
  })
}

export function quotationSubmit(contractId, priceId) {
  return request({
    url: '/lims/contract/syn/price/' + contractId + '/' + priceId,
    method: 'post',
  })
}

// 验证合同是否可以提交 get
export function verify(contractId) {
  return request({
    url: `/lims/contract/verfy/${contractId}`,
    method: 'get',
  })
}


// 更新客户信息点位
export function RenewCustomPoint(contractId) {
  return request({
    url: '/lims/contract/paste/contract/' + contractId,
    method: 'post'
  })
}

// 删除合同登记
export function delContract(contractId) {
  return request({
    url: '/lims/contract/delete/' + contractId,
    method: 'delete'
  })
}

// 合同管理 可选可输 列表内容
export function contractOption(query) {
  return request({
    url: '/lims/contract/custom/pageList',
    method: 'get',
    params: query
  })
}

// 查询业务员列表
export function listUser() {
  return request({
    url: '/system/user/list',
    method: 'get',
  })
}

// 同步委托客户信息
export function postWtCustom(query) {
  return request({
    url: '/lims/contract/syn/wtCustom',
    method: 'post',
    params: query
  })
}

// 同步受检客户信息
export function postSjCustom(query) {
  return request({
    url: '/lims/contract/syn/sjCustom',
    method: 'post',
    params: query
  })
}

// 复制合同
export function copyContract(contractId) {
  return request({
    url: '/lims/contract/copyContract/' + contractId,
    method: 'post'
  })
}


